package com.mingyuan.library.infra.lending.book.exception;


import com.mingyuan.library.domain.common.enums.CommonExceptionCodeEnum;
import com.mingyuan.library.domain.common.exception.BusinessException;

/**
 * 数据库异常
 * @author yangzk
 * @version 1.0.0
 * @date 2022.11.06 11:50
 */
public class DataBaseException extends BusinessException {

    private static final long serialVersionUID = -1820098111294995464L;

    public DataBaseException() {
        super(CommonExceptionCodeEnum.DB_BASE_FAILED);
    }
    public DataBaseException(CommonExceptionCodeEnum errorCodeEnum) {
        super(errorCodeEnum.getErrCode(), errorCodeEnum.getErrMessage());
    }
    public DataBaseException(String errCode, String message) {
        super(errCode, message);
    }
    public DataBaseException(String message) {
        super(CommonExceptionCodeEnum.DB_BASE_FAILED.getErrCode(), message);
    }

    public DataBaseException(Throwable cause) {
        super(CommonExceptionCodeEnum.DB_BASE_FAILED, cause);
    }

    public DataBaseException(String message, Throwable cause) {
        super(CommonExceptionCodeEnum.DB_BASE_FAILED.getErrCode(), message, cause);
    }

}